import request from "@/utils/request";
import {praseStrEmpty} from "@/utils/project";

//查询访客记录信息列表
export function listVisitorRecord(query){
  return request({
    url:'server/visitor/list',
    method:'get',
    params:query
  })
}

//查询访客详细记录信息
export function getVisitorRecord(visitId){
  return request({
    url:'server/visitor/' + praseStrEmpty(visitId),
    method:'get'
  })
}

//新增访客记录
export function addVisitorRecord(data){
  return request({
    url:'server/visitor',
    method:'post',
    data:data
  })
}

//修改访客记录
export function updateVisitorRecord(data){
  return request({
    url:'server/visitor/edit',
    method:'put',
    data:data
  })
}

//删除访客记录
export function deleteVisitorRecord(visitId){
  return request({
    url:'server/visitor/'+visitId,
    method:'delete'
  })
}

//修改审批状态
export function changeVisitorRecordApproverState(data){
  return request({
    url:'server/visitor/changeState',
    method:'put',
    data:data
  })
}

//导出访客记录
export function exprotVisitorRecord(query){
  return request({
    url:'server/visitor/export',
    method:'get',
    params:query
  })
}


